TASM (Assignment) 1
TASM (Assignment) 1
TASM (Assignment) 1
model small .stack 100h .data num1 dw 1 num2 dw 8 .code main proc mov ax, @data mov ds, ax cmp bx, cx jb display1 check: mov dx, 1 add bx, dx sub bx, 30h jmp check
mov bx, num1 ; bx=1 mov cx, num2 ; cx=8 bye: cmp bx, cx jb display1
Submitted by: Almar D. Elipana BSIT-2B ;8 mov dx, bx int 21h .model small .stack 100h .data num1 dw 2 num2 dw 11 .code main proc mov ax, @data mov ds, ax cmp bx, cx jb display1 mov bx, num1 ; bx=2 mov cx, num2 ; cx=11 cmp bx, cx je bye cmp bx, cx jb display1 bye: mov ax, 4c00h int 21h cmp bx, cx je bye line proc mov ah, 02h display1: add bx, 30h mov ah, 02h mov dl, 0ah mov dl, 0dh int 21h check: call line mov dx, 3 add bx, dx sub bx, 30h jmp check
Submitted by: Almar D. Elipana BSIT-2B int 21h ret line endp
Submitted by: Almar D. Elipana BSIT-2B ;1 ;1 ;1 ;1 2 2 2 2 cmp bx,'2' je nl .model small .stack 100h .data space db " ","$" a dw 0 b dw 0 inc bx mov ah,02h mov dx,bx int 21h addnum: cmp bx,'2' jb addnum
mov ah,09h lea dx,space int 21h mov ax,@data mov ds,ax jmp check
check1:
endd:
mov dl, 0ah int 21h ret ;prob. no. 4 ;output: ;* line endp ;* * * * *
Submitted by: Almar D. Elipana BSIT-2B ;* * * * * * go: inc bx mov ah, 09h .model small .stack 100h .data strt dw 0 endd dw 2 spce db " ","$" star db " * ","$" jmp chicks .code main proc mov ax, @data mov ds, ax chicks: cmp bx, cx jne go mov ah, 09h lea dx, spce int 21h lea dx, star int 21h
cmp bx, cx ja go
pop bx
Submitted by: Almar D. Elipana BSIT-2B ;* ;* * * * * disp: inc bx mov ah, 09h .model small .stack 100h .data bgin dw 0 next dw endd dw 8 point db "* ","$" 2 chek: cmp bx, cx jb disp .code main proc mov ax, @data mov ds, ax look: mov bx, bgin add bl, 30h mov dx, 2 add cx, dx call line mov cx, next add cl, 30h pop bx mov bx, bgin cmp bx, cx jb disp mov dx, endd add bx, 30h cmp bx, cx je look jmp chek lea dx, point int 21h
cmp dx, cx
je end1
end1: mov ah, 4ch int 21h line proc mov ah, 02h mov dl,0dh int 21h mov dl, 0ah int 21h ret
line endp ;prob. no. 6 main endp end main ;output: ;& & ;& &
Submitted by: Almar D. Elipana BSIT-2B ;& & ;& & ;& & add1: inc bx mov ah, 09h lea dx, amper .model small .stack 100h .data strtnum ednnum amper space dw 0 dw 5 db " & ","$" db "","$" cmp bx, 2 jne check .code main proc mov ax, @data mov ds, ax check: mov bx, strtnum ;bx=0 add bl, 30h cmp bx, 2 jne add1 cmp bx, 2 je next mov ah, 09h lea dx, space int 21h int 21h
Submitted by: Almar D. Elipana BSIT-2B add bl, 30h end main
mov dl, 0ah int 21h ret line endp ;prob. no. 8 ;output: ;& main endp ;& & & & & &
Submitted by: Almar D. Elipana BSIT-2B ;& & & & & here: inc bx mov ah, 09h .model small .stack 100h .data zro tre dw 0 dw 3 mov ah, 09h lea dx, aprt int 21h lea dx, strs int 21h
jmp look .code main proc mov ax, @data mov ds, ax look: cmp bx, cx jne here
Submitted by: Almar D. Elipana BSIT-2B pop bx cmp bx, cx jne here
line endp
;1 2 2 3 3 4 4
Submitted by: Almar D. Elipana BSIT-2B .model small .stack 100h .data num1 num2 x dw 1 dw 2 db "4","$" cmp bx, 4 .code main proc mov ax, @data mov ds, ax den: mov dx, 1 add bx, dx mov bx, num1 ;bx=1 mov cx, num2 ;cx=2 pop dx cmp bx, cx jne nxt mov dx, 1 add cx, dx sub cl, 30h nxt: add bl, 30h mov ah, 02h cmp cx, 5 jb nxt sub bl, 30h jne den mov dx, cx int 21h add cl, 30h mov ah, 02h
Submitted by: Almar D. Elipana BSIT-2B bye: mov ax, 4c00h int 21h
jmp bye
Submitted by: Almar D. Elipana BSIT-2B .model small .stack 100h .data num1 dw 3 num2 dw 2 x db "12","$" cmp bx, 12 .code main proc mov ax, @data mov ds, ax den: mov dx, 3 add bx, dx mov bx, num1 ;bx=3 mov cx, num2 ;cx=2 pop dx cmp bx, cx jne nxt mov dx, 2 add cx, dx sub cl, 30h nxt: add bx, 30h mov ah, 02h cmp cx, 8 jb nxt sub bl, 30h jne den mov dx, cx int 21h add cx, 30h mov ah, 02h
Submitted by: Almar D. Elipana BSIT-2B bye: mov ax, 4c00h int 21h
jmp bye