Skip to content

Instantly share code, notes, and snippets.

View coderarjob's full-sized avatar
🎪
Focusing

Arjob Mukherjee coderarjob

🎪
Focusing
View GitHub Profile
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
bits 16
section .bss
global _ch
_ch:
resb 1
section .text
global _main
_main:
bits 16
section .bss
global _ch
_ch:
resb 1
section .text
global _main
_main:
@coderarjob
coderarjob / Listing
Created July 28, 2019 17:35
Bruce's C compiler Source
call start
jmp short 0x3
start:
push bp
mov bp,sp
push di
push si
dec sp
xor al,al
/* 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)