1. Register transfer value
1 Page 60 , 132 2 Title stack pass value 3 ; ------------------------------------ 4 . Model small 5 . Stack 64 6 ; ------------------------------------ 7 . Data 8 BCX DW 65535 ; Multiplier 9 Muls DW 2 ; Multiplier 10 ; ------------------------------------ 11 . Code 12 Main proc far 13 MoV Ax, @ data 14 MoV DS, ax 15 16 Push BCX 17 Push Muls 18 19 Call Mymul 20 21 MoV Ax, 4c00h 22 Int 21 h 23 Main endp ; Process ended 24 25 Mymul proc near 26 Push BP 27 MoV BP, SP 28 MoV Ax, SS: [Bp + 6 ] 29 Mul Word PTR SS: [Bp + 4 ] 30 31 Pop BP 32 RET 4 33 Mymul endp 34 35 End main ; ProgramEnd 36
2. Stack value.
1 Page 60 , 132 2 Title stack pass value 3 ; ------------------------------------ 4 . Model small 5 . Stack 64 6 ; ------------------------------------ 7 . Data 8 BCX DW 65535 ; Multiplier 9 Muls DW 2 ; Multiplier 10 ; ------------------------------------ 11 . Code 12 Main proc far 13 MoV Ax, @ data 14 MoV DS, ax 15 16 Push BCX 17 Push Muls 18 19 Call Mymul 20 21 MoV Ax, 4c00h 22 Int 21 h 23 Main endp ; Process ended 24 25 Mymul proc near 26 Push BP 27 MoV BP, SP 28 MoV Ax, SS: [Bp + 6 ] 29 Mul Word PTR SS: [Bp + 4 ] 30 31 Pop BP 32 RET 4 33 Mymul endp 34 35 End main ; Program ended 36
3. Register transfer reference
1 Page 60 , 132 2 Title register transfer reference 3 ; ------------------------------------ 4 . Model small 5 . Stack 64 6 ; ------------------------------------ 7 . Data 8 BCX DW 65535 ; Multiplier 9 Muls DW 2 ; Multiplier 10 ; ------------------------------------ 11 . Code 12 Main proc far 13 MoV Ax, @ data 14 MoV DS, ax 15 Lea BX, BCX 16 Lea Si, muls 17 18 Call Mymul 19 20 MoV Ax, 4c00h 21 Int 21 h 22 Main endp ; Process ended 23 24 Mymul proc near 25 MoV Ax, [BX] 26 Mul Word PTR [Si] 27 RET 28 Mymul endp 29 30 End main ; Program ended 31
4. Stack reference
1 Page60 , 132 2 Title stack reference 3 ; ------------------------------------ 4 . Model small 5 . Stack 64 6 ; ------------------------------------ 7 . Data 8 BCX DW 65535 ; Multiplier 9 Muls DW 2 ; Multiplier 10 ; ------------------------------------ 11 . Code 12 Main proc far 13 MoV Ax, @ data 14 MoV DS, ax 15 16 Lea Ax, offset BCX 17 Push Ax 18 Lea Ax, offset muls 19 Push Ax 20 Call Mymul 21 22 MoV Ax, 4c00h 23 Int 21 h 24 Main endp ; Process ended 25 26 Mymul proc near 27 28 Push BP 29 MoV BP, SP 30 MoV BX, [bp + 6 ] 31 MoV Si, [bp + 4 ] 32 MoV Ax, [BX] 33 Mul Word PTR [Si] 34 35 Pop BP 36 RET 4 37 38 Mymul endp 39 40 End main; Program ended 41