name "template-tema1" ; add the library routines we want to use include 'emu8086.inc' DATA SEGMENT kInput db "Enter a:> " ,0 kOutput db "Just dummy output to add data" ; add your data here! ENDS STACK SEGMENT ; reserve some space for the stack dw 128 dup(0) ENDS PROG SEGMENT ASSUME CS:PROG,SS:STACK,DS:DATA ; converts a value in AX to a string label at SI CONVERT PROC NEAR PUSH AX PUSH SI ; LAB3 add the code here to print a decimal number POP SI POP AX RET CONVERT ENDP ; This macro defines a procedure that gets the multi-digit SIGNED number from the keyboard, ; and stores the result in CX register: DEFINE_SCAN_NUM ; this macro defines a procedure to print a null terminated ; string at current cursor position, receives address of string in DS:SI DEFINE_PRINT_STRING ; this label gets called from the DOS system start: ; we actually set the data and stack segment mov AX, DATA mov DS, AX mov AX, STACK mov SS, AX ; read a number from the console lea si, kInput CALL PRINT_STRING CALL SCAN_NUM ; print our read number MOV AX, CX LEA SI, kOutput CALL CONVERT CALL PRINT_STRING mov ax, 4c00h ; exit to operating system. int 21h ENDS end start ; set entry point and stop the assembler.