As explained in the title, I need to make this code able to do the same things it do using just 16bit but adding .386 to the code so I can use 32bit registers. But when I add the .386 now my code isn't printing anything, any idea how I can fix this. Is it something wrong with my mov as, @data or do I need to add something else? I am using TASM
TITLE Programa de prueba(prueba.asm)
.386
.model small
.stack
.data
escoga db 10,13,7, 'Escoga la operacion: 1. x and y, 2. x or y, 3. not x, 4. x xor y, 5. terminar:
', '$'
digite1 db 10,13,7, 'Digite el primer numero hexadecimal: ', '$'
digite2 db 10,13,7, 'Digite el segundo numero hexadecimal: ', '$'
Yval db "Enter Y hexadecimal value: ",0
resultStr db "The result is: ",0
result db ?
x db 8 DUP(' '),'$'
y db 8 DUP(' '),'$'
num db 1 DUP(0),'$'
.code
main proc
mov ax, @data
mov ds, ax
.loop1:
cmp si, 82
je .done1
mov ah, 0Eh
mov al, escoga[SI]
mov bh, 00h
int 10h
inc si
jmp .loop1
.done1:
mov si, 0
mov di, 0
.inp1:
cmp si, 1
je .ext1
mov ah, 00h
int 16h
inc si
inc di
jmp .modi1
.modi1:
mov num[di], al
mov ah, 0Eh
mov al, num[di]
mov bh, 00h
int 10h
jmp .inp1
.ext1:
mov si, 0
.ext2:
cmp si, 2
je .salir
mov ah, 0Eh
mov al, num[SI]
inc si
jmp .ext2
.salir:
cmp num[SI-1], '5'
jge .term
jmp .term2
.term2:
mov si, 0
.loop2:
cmp si, 40
je .done2
mov ah, 0Eh
mov al, digite1[SI]
mov bh, 00h
int 10h
inc si
jmp .loop2
.done2:
mov si, 0
mov di, 0
.inp2:
cmp si, 8
je .ext3
mov ah, 00h
int 16h
inc si
inc di
jmp .modi2
.modi2:
mov x[di], al
mov ah, 0Eh
mov al, x[di]
mov bh, 00h
int 10h
jmp .inp2
.ext3:
mov si, 0
mov di, 0
.loop3:
cmp si, 41
je .done3
mov ah, 0Eh
mov al, digite2[SI]
mov bh, 00h
int 10h
inc si
jmp .loop3
.done3:
mov si, 0
mov di, 0
.inp3:
cmp si, 8
je .ext4
mov ah, 00h
int 16h
inc si
inc di
jmp .modi3
.modi3:
mov y[di], al
mov ah, 0Eh
mov al, y[di]
mov bh, 00h
int 10h
jmp .inp3
.ext4:
mov si, 0
mov di, 0
.term:
.exit
main endp
end main
.loop1
loop usingsi
when you haven't initializedsi
at that point? – Hexahydrate.386
after.model small
rather than before so change it to.model small
.386
– Covalence