This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System calls will reside in the segment of the kernel or the device | |
| drivers. The caller function however can be on a different segment, and use | |
| to INT instruction to call any system call. | |
| Calling Convention: | |
| ------------------ | |
| A) Memory convention: | |
| Application programs (AP) in Megha have 'small' memory model: DS = SS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bits 16 | |
| section .bss | |
| global _ch | |
| _ch: | |
| resb 1 | |
| section .text | |
| global _main | |
| _main: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bits 16 | |
| section .bss | |
| global _ch | |
| _ch: | |
| resb 1 | |
| section .text | |
| global _main | |
| _main: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| call start | |
| jmp short 0x3 | |
| start: | |
| push bp | |
| mov bp,sp | |
| push di | |
| push si | |
| dec sp | |
| xor al,al |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* A sample file to demo the issues with compiling for a real mode 8086 | |
| * environment*/ | |
| asm( | |
| "call main\n\t" | |
| "jmp .\n\t" | |
| ); | |
| #define SET_POS(r,c) (screenpos = r*160 + c*2) |