Question: ASSEMBLY language - Implement the code that is commented on the right side so that the function on the left accepts positive and negative numbers.

ASSEMBLY language - Implement the code that is commented on the right side so that the function on the left accepts positive and negative numbers.

PICTURE:

ASSEMBLY language - Implement the code that is commented on the right

CODE:

IS_UNSIGNED_INT PROC

mov byte ptr IS_VALID, TRUE mov di, 0h mov ah, STRING[di] NEXT_CHAR: cmp ah, '$' ;mov byte ptr SIGNO,1h jz DECIDIR :cmp ah, '-' cmp ah, '0' ;jnz NEXT_CHAR jb DECIDIR ;mov byte ptr SIGNO,-1 cmp ah, '9' ;cmp ah, '+' ja DECIDIR ;jnz NEXT_CHAR inc di ;inc di mov ah, STRING[di] ;mov ah, STRING[di] jmp NEXT_CHAR

DECIDIR:

jnz NOT_VALID cmp di, 0h jnz KEEP NOT_VALID: mov byte ptr IS_VALID, FALSE

KEEP:

RET IS_UNSIGNED_INT ENDP

XXXXXXX : IS_UNSIGNED_INT PROC mov byte ptr IS_VALID, TRUE mov d, oh mov ah, STRING[di] NEXT_CHAR: cmp ah, '' jz DECIDIR cmp ah, 'O' jb DECIDIR cmp ah, '9' ja DECIDIR inc di mov ah, STRING[di] jmp NEXT_CHAR ;mov byte ptr SIGNO, 1h cmp ah, ; jnz NEXT_CHAR ; mov byte ptr SIGNO, -1 icmp ah, + inz NEXT_CHAR ; inc di ;mov ah, STRING[di] DECIDIR: jnz NOT_VALID cmp di, oh jnz KEEP NOT_VALID: mov byte ptr 1S_VALID, FALSE KEEP: RET IS_UNSIGNED_INT ENDP XXXXXXX : IS_UNSIGNED_INT PROC mov byte ptr IS_VALID, TRUE mov d, oh mov ah, STRING[di] NEXT_CHAR: cmp ah, '' jz DECIDIR cmp ah, 'O' jb DECIDIR cmp ah, '9' ja DECIDIR inc di mov ah, STRING[di] jmp NEXT_CHAR ;mov byte ptr SIGNO, 1h cmp ah, ; jnz NEXT_CHAR ; mov byte ptr SIGNO, -1 icmp ah, + inz NEXT_CHAR ; inc di ;mov ah, STRING[di] DECIDIR: jnz NOT_VALID cmp di, oh jnz KEEP NOT_VALID: mov byte ptr 1S_VALID, FALSE KEEP: RET IS_UNSIGNED_INT ENDP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!