From 1aeca2e3583a583d35c0f3c5877fc7c607091c3b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 5 Jun 2018 12:50:41 -0500 Subject: [PATCH] added regestry example to 16 for dumping of stuff wwww --- 16/reg_ex.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 16/vgmtools | 2 +- src/lib/doslib | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 16/reg_ex.c diff --git a/16/reg_ex.c b/16/reg_ex.c new file mode 100755 index 00000000..a7425544 --- /dev/null +++ b/16/reg_ex.c @@ -0,0 +1,55 @@ +#include + + + +void main() +{ + //GENERAL PURPOSE + short _ax,_bx,_cx,_dx; + short _si,_di; + short _bp,_sp; + + short _cs,_ds,_es,_ss; //SEGMENT + short _ip; //SPECIAL PURPOSE + char _cf,_pf,_af,_zf,_sf,_tf,_if,_df,_of; //FLAGS + + __asm { + mov _ax,ax + mov _bx,bx + mov _cx,cx + mov _dx,dx + + mov _si,si + mov _di,di + mov _bp,bp + mov _sp,sp + + mov _cs,cs + mov _ds,ds + mov _es,es + mov _ss,ss + + /*mov _ip,ip + + mov _cf,cf + mov _pf,pf + mov _af,af + mov _zf,zf + mov _sf,sf + mov _tf,tf + mov _if,if + mov _df,df + mov _of,of*/ + } +// printf("integer values: ax=%d bx=%d cx=%d dx=%d\n", a, b, c, d); +// printf("unsigned values:ax=%u bx=%u cx=%u dx=%u\n", a, b, c, d); + printf("16 bit 8088 register values\n"); + printf("general purpose:\n"); + printf(" ax=%d\n bx=%d\n cx=%d\n dx=%d\n\n", _ax, _bx, _cx, _dx); + printf(" si=%d\n di=%d\n bp=%d\n sp=%d\n", _si, _di, _bp, _sp); + printf("segment:\n"); + printf(" cs=%d\n ds=%d\n es=%d\n ss=%d\n", _cs, _ds, _es, _ss); +// printf(" ip=%d\n\n", _ip); +// printf(" cf=%d\npf=%d\naf=%d\nzf=%d\nsf=%d\ntf=%d\nif=%d\ndf=%d\nof=%d\n", _cf, _pf, _af, _zf, _sf, _tf, _if, _df, _of); + printf("for more info see\n http://stackoverflow.com/questions/9130349/how-many-registers-are-there-in-8086-8088\n"); +} diff --git a/16/vgmtools b/16/vgmtools index 057e0126..a59529ed 160000 --- a/16/vgmtools +++ b/16/vgmtools @@ -1 +1 @@ -Subproject commit 057e0126a66a4d287508d79f9a407a0a30293c5f +Subproject commit a59529ede4026a6d7fb0005621537d53c78f211a diff --git a/src/lib/doslib b/src/lib/doslib index 95e54cfb..ae5d9881 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 95e54cfb9b31f35a793e36735ff25c8d81b0653f +Subproject commit ae5d98814539f01c57bb012f7e5c7652011988da -- 2.39.2