Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; PointerIntegerAdd (procedura koju uvozi objektni fajl "program.obj" za pristup nizovima)
- public __PIA
- extern _prekidnaRutina : far ptr
- extern _glavnaFunkcija : far ptr
- RAM_SIZE_IN_PAR equ 0x1000
- ivtRam segment 'IVTRAM'
- dd 256 dup(_prekidnaRutina)
- ivtRam ends
- startup segment 'STARTUP'
- lab_start:
- jmp far ptr pocetak
- lab_end:
- db (16 - (lab_end - lab_start)) dup(0)
- startup ends
- text segment 'CODE'
- pocetak:
- mov ax, stackStart
- mov ss, ax
- mov bx, RAM_SIZE_IN_PAR
- cmp bx, ax
- mali_ram:
- jbe mali_ram
- sub bx, ax ;vel u PAR
- test bx, 0xf000
- jnz max_sp
- mov cl, 4
- shl bx, cl ;vel u B
- mov sp, bx
- jmp inic_IVT_transfer
- max_sp:
- mov sp, 0xfffe
- inic_IVT_transfer:
- mov ax, 0
- mov si, ax
- mov di, ax
- mov ax, ivtRam
- mov ds, ax
- mov ax, ivtRom
- mov es, ax
- mov bx, dataRom
- sub bx, ax ;vel u PAR
- mov cl, 3
- shl bx, cl ;vel u W
- mov cx, bx
- jcxz inic_DATA_transfer
- IVT_transfer:
- mov ax, es:[si]
- mov ds:[di], ax
- add si, 2
- add di, 2
- loop IVT_transfer
- inic_DATA_transfer:
- mov ax, 0
- mov si, 0
- mov di, 0
- mov ax, dataRam
- mov ds, ax
- mov ax, dataRom
- mov es, ax
- mov bx, dataRomEnd
- sub bx, ax ;vel u PAR
- mov cl, 3
- shl bx, cl ;vel u W
- mov cx, bx
- jcxz gl_prog
- DATA_transfer:
- mov ax, es:[si]
- mov ds:[di], ax
- add si, 2
- add di, 2
- loop DATA_transfer
- gl_prog:
- call _glavnaFunkcija
- inf:
- jmp inf
- __PIA proc far
- add AX, BX
- retf
- __PIA endp
- text ends
- ; ----------------------------------
- ivtRom segment 'IVTROM'
- ivtRom ends
- dataRomEnd segment 'DATAROMEND'
- dataRomEnd ends
- stackStart segment 'STACKSTART'
- stackStart ends
- dataRom segment 'DATAROM'
- dataRom ends
- dataRam segment 'DATARAM'
- dataRam ends
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement