Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- steps:
- >tasm file1.asm
- >tasm file2.asm
- >tlink f1.obj f2.obj
- >type f1.map
- >f1.exe ;like before
- 1. Find LCM using far proc
- ;------------------------file1.asm---------
- extrn x : far
- public a
- public b
- public ans
- data segment
- a db 5
- b db 10
- ans dw ?
- data ends
- code segment
- assume cs:code, ds:data
- mov ax,data
- mov ds,ax
- xor ax,ax
- call x
- int 3
- code ends
- end
- ;------------------file2.asm----------
- public x
- extrn a:byte
- extrn b:byte
- extrn ans:word
- c4 segment
- assume cs:c4
- x proc far
- mov al,a
- mov bl,b
- one: cmp al,bl
- jc loop1
- loop1: xchg al,bl
- jmp read
- read: sub al,bl
- jnz one
- mov al,bl
- mov al,a
- mov cl,b
- mul cl
- div bl
- int 3
- ret
- x endp
- c4 ends
- end
- 2. Convert celcius to fahrenheit using far proc
- 3. Given a string "hello world hello" find out the occurence of hello. After that, replace "hello" with "hi".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement