0

I'm stuck on enter string, display entered string and convert string upper case to lower case.

I have to use emu8086.inc but I don't know how to convert this code below to accept string instead of number/integer. Anybody willing to guide further on this matter?

8086 asm CODE:

include 'emu8086.inc'

ORG    100h 

LEA    SI, msg1      
CALL   print_string   
CALL   scan_num       

MOV    AX, CX       

; print the following string:
CALL   pthis
DB  13, 10, 'You have entered: ', 0

CALL   print_num      

RET          

msg1   DB  'Enter the number: ', 0

DEFINE_SCAN_NUM
DEFINE_PRINT_STRING
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS 
DEFINE_PTHIS
END              

Thank you in advance.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
missy
  • 1
  • 1

1 Answers1

0

I'm not sure what emu8086.inc includes for functions.

On Linux systems you may be able to use a system call though I am not sure having never used Linux. On Windows you'll be best off including a C function like scanf by linking with MSVCRT.dll, or a Windows provided console function (see Console functions) which you link with Kernell32.dll. I'd look into your assemblers documentation for how to link to a dll and call the individual functions. The C runtime MSVCRT.dll also includes the function "toupper" which converts a string to uppercase. Windows probably has a similar function though I'm not sure of it.

  • RTFM: http://www.itipacinotti.it/pagine/sistemi2008/documentation_emulator/index.html Looks like you need `get_string`. Linux and/or Windows functions are fine... but not on 8086! – Frank Kotler Dec 07 '12 at 21:51
  • emu8086.inc is a library common function. To use any of the functions in emu8086.inc we should have the following line in the beginning of our source file: include 'emu8086.inc' – missy Dec 07 '12 at 22:08