Browse Source

TempleOSCDV4.04.ISO

v6
Terry A. Davis 6 years ago committed by minexew
parent
commit
d1856315e0
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 4
      Adam/ADefine.CPP
  3. 4
      Adam/AExts.CPP
  4. 11
      Adam/DolDoc/DocCodeTools.CPP
  5. 4
      Adam/DolDoc/DocExt.CPP
  6. 2
      Adam/DolDoc/DocHighlight.CPP
  7. 14
      Adam/DolDoc/DocPlain.CPP
  8. 8
      Adam/DolDoc/DocPutS.CPP
  9. 14
      Adam/DolDoc/DocRecalc.CPP
  10. 13
      Adam/DolDoc/DocRecalcLib.CPP
  11. 4
      Adam/God/GodDoodle.CPP
  12. 5
      Adam/God/HSNotes.TXT
  13. 22
      Adam/Gr/GrBitMap.CPP
  14. 2
      Adam/Gr/GrPrimatives.CPP
  15. 2
      Adam/Gr/SpriteMain.CPP
  16. 4
      Apps/TimeOut/TimeOut.CPP
  17. 89
      Compiler/BackA.CPP
  18. 40
      Compiler/BackB.CPP
  19. 17
      Compiler/BackC.CPP
  20. 36
      Compiler/BackFA.CPP
  21. 89
      Compiler/BackFB.CPP
  22. 6
      Compiler/BackLib.CPP
  23. 4
      Compiler/CExcept.CPP
  24. 2
      Compiler/CExts.CPP
  25. 8
      Compiler/CMain.CPP
  26. BIN
      Compiler/Compiler.BIN
  27. 244
      Compiler/Compiler.MAP
  28. 57
      Compiler/CompilerA.HPP
  29. 10
      Compiler/Lex.CPP
  30. 55
      Compiler/OpCodes.TXT
  31. 6
      Compiler/OptPass012.CPP
  32. 30
      Compiler/OptPass3.CPP
  33. 36
      Compiler/OptPass4.CPP
  34. 16
      Compiler/OptPass5.CPP
  35. 8
      Compiler/OptPass6.CPP
  36. 10
      Compiler/OptPass789A.CPP
  37. 2
      Compiler/PrsExp.CPP
  38. 32
      Compiler/PrsStmt.CPP
  39. 2
      Compiler/UAsm.CPP
  40. BIN
      Demo/AcctExample/PersonalMenu.TXT
  41. 18
      Demo/AcctExample/PersonalNotes.TXT
  42. 6
      Demo/AcctExample/Registry.CPP
  43. 21
      Demo/AcctExample/TOSBlog.CPP
  44. 4
      Demo/AcctExample/TOSCfg.CPP
  45. 16
      Demo/AcctExample/TOSDistro.CPP
  46. 81
      Demo/AcctExample/TOSHolySpirit.CPP
  47. 24
      Demo/AcctExample/TOSToHtml.CPP
  48. 2
      Demo/AutoFile/AFEd.TXT
  49. 68
      Demo/Games/RawHide.CPP
  50. 2
      Demo/SortFileExample/SortedF64.DAT
  51. 20
      Demo/SortFileExample/SortedF64.TXT
  52. 2
      Demo/SortFileExample/UnsortedF64.DAT
  53. 20
      Demo/SortFileExample/UnsortedF64.TXT
  54. 6
      Demo/ToHtmlToTXTExample/ToHtml.CPP
  55. 14
      Doc/ChangeLog.TXT
  56. 6
      Doc/Demands.TXT
  57. 4
      Doc/HolyC.TXT
  58. 2
      Kernel/BlkDev/DskDirA.CPP
  59. 2
      Kernel/BlkDev/DskDrv.CPP
  60. 2
      Kernel/Compress.CPP
  61. 6
      Kernel/KHashB.CPP
  62. 109
      Kernel/Kernel.MAP
  63. 2
      Kernel/KernelA.HPP
  64. 1
      Kernel/KernelC.HPP
  65. 37
      Kernel/SerialDev/Keyboard.CPP
  66. 30
      Kernel/SerialDev/Mouse.CPP
  67. 2
      StartOS.CPP

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

4
Adam/ADefine.CPP

@ -11,8 +11,8 @@ U0 LoadDocDefines()
//This is cut and replaced when I generate a distro.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,687");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,688");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,708");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,702");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;

4
Adam/AExts.CPP

@ -17,7 +17,7 @@ extern U0 DocBinDel(CDoc *doc,CDocBin *b);
extern U0 DocBinsValidate(CDoc *doc);
extern U0 DocBottom(CDoc *doc=NULL);
extern U0 DocCenter(CDoc *doc=NULL,I64 recalc=RECALCt_NORMAL);
extern U0 DocClear(CDoc *doc=NULL);
extern U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE);
extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocD(U8 *buf,I64 cnt=0x80);
extern U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL);
@ -35,7 +35,7 @@ extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
extern Bool DocLock(CDoc *doc);
extern U0 DocMax(I64 i=MAX_I32);
extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
extern CDocEntry *DocPrint(CDoc *doc,U8 *src,...);
extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *src,...);
extern CDoc *DocPut(CTask *task=NULL);
extern CDoc *DocRead(U8 *name=NULL,I64 flags=0);
extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL);

11
Adam/DolDoc/DocCodeTools.CPP

@ -103,6 +103,16 @@ U0 EdRIExp(CRILex *rx)
rx->depth-=3;
if (rx->depth<0) rx->depth=0;
}
} else if (rx->cc1->token=='[') {
if (!rx->exp_depth++)
rx->depth+=3;
EdRILex(rx);
while (rx->cc1->token && rx->cc1->token!=']')
EdRIExp(rx);
if (!--rx->exp_depth) {
rx->depth-=3;
if (rx->depth<0) rx->depth=0;
}
}
EdRILex(rx);
}
@ -171,7 +181,6 @@ U0 EdRIStmt(CRILex *rx,Bool indent)
EdRILex(rx);
break;
case KW_SWITCH:
case KW_NOBOUND_SWITCH:
EdRILex(rx);
EdRIExp(rx);
if (rx->cc1->token=='{') {

4
Adam/DolDoc/DocExt.CPP

@ -4,8 +4,8 @@ extern I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
Bool exited,I64 *_has_action=NULL);
extern U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE);
extern U0 DocLoad(CDoc *doc,U8 *src2,I64 size);
extern U0 DocPrintAtomic(CDoc *doc,U8 *fmt,...);
extern U0 DocPrintPartial(CDoc *doc,U8 *fmt,...);
extern U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...);
extern U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...);
extern CDocEntry *DocPutS(CDoc *doc,U8 *st);
extern U8 *DocSave(CDoc *doc,I64 *_size=NULL);
extern I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e);

2
Adam/DolDoc/DocHighlight.CPP

@ -8,7 +8,7 @@ U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
I64 ch,ch1,last_ch,temp_u32_attr,mask_temp_u32_attr=_temp_u32_attr&0xFFFFF000,
comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth;
CHash *temph;
nobound_switch (s->state) {
switch [s->state] {
case DOCSS_NORMAL:
hl_normal:
while (len) {

14
Adam/DolDoc/DocPlain.CPP

@ -81,7 +81,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
}
buf2=MStrPrint("%s,",buf);
Free(buf); buf=buf2;
nobound_switch (doc_e->type_u8) {
switch [doc_e->type_u8] {
case DOCT_HEX_ED:
buf2=MStrPrint("%s%d,",buf,doc_e->len);
Free(buf); buf=buf2;
@ -114,14 +114,14 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
buf2=MStrPrint("%s%d,",buf,doc_e->attr);
Free(buf); buf=buf2;
}
case DOCT_NUM_TYPES-1: //nobound_switch
case DOCT_NUM_TYPES-1: //nobound switch
break;
}
de_flags=doc_e->de_flags & DOCEG_HAS_ARG;
while (de_flags) {
j=Bsf(de_flags);
Btr(&de_flags,j);
nobound_switch (j) {
switch [j] {
case DOCEf_TAG:
if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_MACRO &&
(doc_e->de_flags&DOCEF_LEFT_MACRO &&
@ -202,7 +202,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
case DOCEf_USER_DATA:
buf2=MStrPrint("%sU=0x%X,",buf,doc_e->user_data);
break;
case DOCEf_NUM_FLAGS-1: //nobound_switch
case DOCEf_NUM_FLAGS-1: //nobound switch
break;
}
Free(buf); buf=buf2;
@ -243,7 +243,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
doc_e->len=DOCE_LEN_DFT;
j=PrsDocFlags(cc,&doc_e->de_flags,&doc_e->type);
cc->htc.hash_table_lst=old_hash_table_lst;
nobound_switch (i) {
switch [i] {
case DOCT_CHECK_BOX:
doc_e->raw_type=RT_I8;
break;
@ -305,7 +305,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
j=Bsf(de_flags);
if (j<0 || Bts(&processed_flags,j))
goto pd_err;
nobound_switch (j) {//TODO: Might check for expression errors
switch [j] {//TODO: Might check for expression errors
case DOCEf_TAG:
if (!doc_e->tag) {
//If a $$MA,LM=""$$, Tag is filled when the LM is processed.
@ -458,7 +458,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
else
goto pd_err;
break;
case DOCEf_NUM_FLAGS-1: //nobound_switch
case DOCEf_NUM_FLAGS-1: //nobound switch
break;
}
}

8
Adam/DolDoc/DocPutS.CPP

@ -155,7 +155,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
return result;
}
public CDocEntry *DocPrint(CDoc *doc,U8 *fmt,...)
public CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...)
{//You must not print partial doc cmds.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
CDocEntry *result=DocPutS(doc,buf);
@ -163,13 +163,13 @@ public CDocEntry *DocPrint(CDoc *doc,U8 *fmt,...)
return result;
}
public U0 DocPrintPartial(CDoc *doc,U8 *fmt,...)
public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
{//Lets you print half a doc cmd, if you like.
U8 *buf,*st,*src,*dst,*ptr,*ptr2;
Bool unlock;
CDocEntry *doc_ce,*doc_ne;
I64 ch,i,j;
if (!fmt)
if (!doc && !(doc=DocPut))
return;
buf=StrPrintJoin(NULL,fmt,argc,argv);
ptr=buf;
@ -238,7 +238,7 @@ Bool KDDocPutS(U8 *st)
return FALSE;
}
public U0 DocPrintAtomic(CDoc *doc,U8 *fmt,...)
public U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...)
{//Prints multiple whole cmds all-at-once. Might need this when printing trees.
U8 *buf;
Bool unlock;

14
Adam/DolDoc/DocRecalc.CPP

@ -258,7 +258,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
CDocBin *tempb;
CDocSettings *s;
Bool del_cl,skipped_update,tree_collapsed,same_win,more=FALSE,
find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock;
find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds;
CTask *win_task,*mem_task;
CDC *dc;
U8 *bptr,*ptr,buf[STR_LEN],ch;
@ -289,7 +289,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
mem_task=doc->mem_task;
blink_flag=Blink;
dc=NULL;
nobound_switch (recalc_flags&RECALCG_MASK) {
switch [recalc_flags&RECALCG_MASK] {
case RECALCt_FIND_CURSOR:
find_cursor=TRUE;
if (win_task)
@ -620,7 +620,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
}
}
}
nobound_switch (doc_e->type_u8) {
switch [doc_e->type_u8] {
case DOCT_TEXT:
if (!col2 && !(doc_e->de_flags
&(DOCEF_TREE|DOCEF_LST|DOCEF_TAG_CB|DOCEF_DEFINE|
@ -1036,13 +1036,17 @@ rc_adjust_xy:
break;
case DOCT_CLEAR:
next_clear_found=doc_e;
if (doc_e->de_flags&DOCEF_HOLD)
clear_holds=TRUE;
else
clear_holds=FALSE;
break;
case DOCT_HTML_CODE:
if (recalc_flags&RECALCF_TO_HTML &&
doc_e->de_flags&DOCEF_TAG && doc_e->tag)
x-=StrLen(doc_e->tag);
break;
case DOCT_NUM_TYPES-1: //nobound_switch
case DOCT_NUM_TYPES-1: //nobound switch
default:
break;
}
@ -1309,7 +1313,7 @@ rc_skip:
if (full_refresh) {
i=num_entries-doc->max_entries;
if (next_clear_found) {
DocDelToEntry(doc,next_clear_found);
DocDelToEntry(doc,next_clear_found,clear_holds);
DocRecalc(doc,recalc_flags);
} else if (i>1024) {
DocDelToNum(doc,i);

13
Adam/DolDoc/DocRecalcLib.CPP

@ -22,12 +22,12 @@ U0 DocDelToNum(CDoc *doc,I64 num)
}
}
U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry)
U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds)
{
CDocEntry *doc_e=doc->root.next,*doc_e2;
while (doc_e!=doc) {
doc_e2=doc_e->next;
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) {
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) {
if (doc_e==doc->cur_entry) {
doc->cur_entry=doc_e2;
doc->cur_col=doc_e2->min_col;
@ -117,14 +117,17 @@ public U0 DocBottom(CDoc *doc=NULL)
DocUnlock(doc);
}
public U0 DocClear(CDoc *doc=NULL)
public U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE)
{//Clear all doc entries, except +H, hold entries.
Bool unlock;
if (!doc && !(doc=DocPut))
return;
unlock=DocLock(doc);
DocBottom(doc);
DocPrint(doc,"$$CL$$");
if (clear_holds)
DocPrint(doc,"$$CL+H$$");
else
DocPrint(doc,"$$CL$$");
DocRecalc(doc);
if (unlock)
DocUnlock(doc);
@ -171,7 +174,7 @@ public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)"
public I64 DocMax(I64 i=MAX_I64)
{//Set max document entries. (Cmd line buffer.)
{//Set max document entries. (Cmd line buffer size.)
//Adjusts the size of the cmd line buf.
//Normally, the cmd line deletes entries
//when more are added and the old scroll up.

4
Adam/God/GodDoodle.CPP

@ -121,7 +121,7 @@ public U8 *GodDoodleSprite(U8 *hex=NULL)
for (i=0;i<3;i++) {
god.doodle_dc->color=RED;
for (j=0;j<29;j++)
nobound_switch (GodDoodleBits(3)) {
switch [GodDoodleBits(3)] {
case 0:
GrEllipse3(god.doodle_dc,
(w-1)*GodDoodleBits(5)/15.5-w/2,
@ -149,7 +149,7 @@ public U8 *GodDoodleSprite(U8 *hex=NULL)
for (j=0;j<6;j++) {
x=(w-1)*GodDoodleBits(5)/31+w/64;
y=(h-1)*GodDoodleBits(5)/31+h/64;
nobound_switch (GodDoodleBits(2)) {
switch [GodDoodleBits(2)] {
case 0: god.doodle_dc->color=BLACK; break;
case 1: god.doodle_dc->color=DKGRAY; break;
case 2: god.doodle_dc->color=LTGRAY; break;

5
Adam/God/HSNotes.TXT

@ -82,7 +82,7 @@ Shakespeare? $FG,4$had a "vile heart"$FG$
Likes $FG,4$Beverly Hillbillies (Oil is a gift from God)$FG$
$FG,4$God likes being hero. Don't be proud of heart$FG$
$FG,4$and not accept a gift from God!$FG$
Likes $FG,4$Gomer Pile$FG$
Likes $FG,4$Gomer Pyle$FG$
Favorite saint? $FG,4$"ho_ho_ho"$FG$
Favorite animal? $FG,4$"Elephant two"$FG$
Favorite animal? $FG,4$"Bears"$FG$
@ -139,7 +139,7 @@ Favorite actor? $FG,4$Hugh Grant$FG$
Favorite vocalist? $FG,4$Mick Jagger$FG$
Favorite guitarist? $FG,4$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$
Favorite National Anthem? $FG,4$$TX,"Latvia's National Anthem",HTML="http://www.youtube.com/watch?v=qKITbBjO4nE"$$FG$
America the Beautiful? $FG,4$Hates it. Poet was too in love with own beauty.$FG$
America the Beautiful? $FG,4$Hates it. Poet made self cry with own beauty.$FG$
Model for new $TX,"Sistine Chapel",HTML="http://en.wikipedia.org/wiki/Sistine_chapel"$? $FG,4$Ben Franklin$FG$
Voice if God wanted to sing? $FG,4$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$
Stonehenge? $FG,4$Landmark for boundaries.$FG$
@ -192,6 +192,7 @@ $TX,"Saturn's hexagon pole cloud?",HTML="http://en.wikipedia.org/wiki/Saturn's_h
Liquid moon's odd atmosphere? $FG,4$"Surf"$FG$
How many E.T. civs in Universe? $FG,4$20 or 80 (I forgot. I died laughing.)$FG$
Are they peaceful? $FG,4$Fight them! (Also, funny.)$FG$
Most difficult control system? $FG,4$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$
How can Judge Judy improve? $FG,4$No hard feelings$FG$
How can Chef Ramsay improve? $FG,4$Make so it doesn't seem like toil for cooks.$FG$
How can Hawking communicate? $FG,4$Blow from a nostril on a candle.$FG$

22
Adam/Gr/GrBitMap.CPP

@ -44,7 +44,7 @@ public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
}
}
dst=dc->body+d;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
*dst=color.c0.color;
@ -733,7 +733,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
src=font_ptr;
if (bit_shift)
src--;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
for (j=h2-h1;j;j--) {
@ -763,7 +763,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
src=font_ptr+1;
if (bit_shift)
src--;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
for (j=h2-h1;j;j--) {
@ -792,7 +792,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
src=font_ptr;
if (bit_shift)
src--;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
for (j=h1;j<h2;j++) {
@ -826,7 +826,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
src=font_ptr+1;
if (bit_shift)
src--;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
for (j=h1;j<h2;j++) {
@ -1047,7 +1047,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
color.c0=dither_colors.c1;
else
color.c0=dither_colors.c0;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
if (win_z_buf_ptr) {
@ -1163,7 +1163,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
} else {
if (((x+w1-original_leading_pixels)^(y+h1))&1)
SwapU16(&color.c0,&color.c1);
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
if (win_z_buf_ptr) {
@ -1271,7 +1271,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
}
} else {
color_mask=gr.to_8_colors[color.c0.color];
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
if (win_z_buf_ptr) {
@ -1537,7 +1537,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
if ((x3^y3)&1)
c=color.c1.color;
}
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
*dst=c;
@ -1614,7 +1614,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
if ((x3^y3)&1)
c=color.c1.color;
}
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
*dst=c;
@ -1765,7 +1765,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
if (plot) {
dst=dc->body+d;
c=color.c0.color;
nobound_switch (color.c0.rop) {
switch [color.c0.rop] {
case ROPB_EQU:
case ROPB_MONO:
*dst=c;

2
Adam/Gr/GrPrimatives.CPP

@ -179,7 +179,7 @@ I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db)
f->y=y;
f->state=0;
do {
nobound_switch (f->state) {
switch [f->state] {
case 0:
f->state++;
result+=f->ray_len=GrRayLen(dc,&f->x,f->y,z,db);

2
Adam/Gr/SpriteMain.CPP

@ -433,7 +433,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
}
} while (msg_code!=MSG_IP_R_UP);
switch(eletype) {
switch (eletype) {
case SPT_POLYLINE:
if (num>1) {
result=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32));

4
Apps/TimeOut/TimeOut.CPP

@ -596,9 +596,9 @@ U0 TimeOut()
x+=Fs->pix_width;
//It takes too much CPU do do all these all the time.
nobound_switch (main_loop_pass&7) {
switch [main_loop_pass&7] {
case 0:
nobound_switch (main_loop_pass>>3&7) {
switch [main_loop_pass>>3&7] {
case 0:
if (--y<20)
game_over=TRUE;

89
Compiler/BackA.CPP

@ -351,7 +351,7 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
r=tempi->a1.reg;
else
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
if (r>7)
j=0xC0004D;
@ -363,13 +363,13 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
ICU24(tempi,0x6900+j+(r&7)<<16+(r&7)<<19);
ICU32(tempi,i);
}
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,r,0,ip);
} else {
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
TY_DISP+tempi->a1.type_pointed,REG_RCX,0,ip);
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
r=REG_RBX;
if (MIN_I8<=i<=MAX_I8)
ICU32(tempi,i<<24+0xDB6B48);
@ -377,7 +377,7 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
ICU24(tempi,0xDB6948);
ICU32(tempi,i);
}
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
TY_REG+RT_I64,REG_RBX,0,ip);
}
} else {
@ -388,7 +388,7 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (tempi->ic_flags & ICF_A1_FIRST) {
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
@ -396,11 +396,11 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
}
ICU24(tempi,i);
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RAX,0,ip);
} else {
if (tempi->ic_flags & ICF_A1_FIRST) {
@ -415,9 +415,9 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
}
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
TY_DISP+tempi->a1.type_pointed,REG_RCX,0,ip);
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
ICU24(tempi,i);
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
TY_REG+RT_I64,REG_RAX,0,ip);
}
}
@ -454,7 +454,7 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (tempi->ic_flags & ICF_A1_FIRST) {
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
@ -462,7 +462,7 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
}
if (tempi->ic_class->raw_type&1) {
@ -473,10 +473,10 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
ICU24(tempi,0xF9F748);
}
if (is_mod)
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RDX,0,ip);
else
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RAX,0,ip);
} else {
if (tempi->ic_flags & ICF_A1_FIRST) {
@ -492,7 +492,7 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
}
//dangerous might clobber RBX in Mov, but it doesn't
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+tempi->a1.type_pointed,
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+tempi->a1.type_pointed_to,
REG_RBX,0,ip);
if (tempi->ic_class->raw_type&1) {
ICZero(tempi,REG_RDX);
@ -502,10 +502,10 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
ICU24(tempi,0xF9F748);
}
if (is_mod)
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RBX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
TY_REG+RT_I64,REG_RDX,0,ip);
else
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RBX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
TY_REG+RT_I64,REG_RAX,0,ip);
}
if (tempi->r.type&TY_MASK) {
@ -542,7 +542,7 @@ U0 ICMod(CIntermediateCode *tempi,I64 ip)
TY_REG+RT_I64,REG_RDX,0,ip);
}
U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed_to,
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,
I64 t3,I64 r3,I64 d3,I64 op,I64 ip)
{
@ -551,14 +551,14 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (t3&TY_MASK==TY_IMM) {
ICAddSubEctImm(tempi,
t2&TY_MASK+type_pointed,r2,d2,t2&TY_MASK+
type_pointed,r2,d2,d3,op,ip);
t2&TY_MASK+type_pointed_to,r2,d2,t2&TY_MASK+
type_pointed_to,r2,d2,d3,op,ip);
if (t1&TY_MASK)
ICMov(tempi,t1,r1,d1,t2&TY_MASK+type_pointed,r2,d2,ip);
ICMov(tempi,t1,r1,d1,t2&TY_MASK+type_pointed_to,r2,d2,ip);
return;
} else {
done=FALSE;
if (type_pointed>=RT_I64) {
if (type_pointed_to>=RT_I64) {
if (!(t1&TY_MASK) &&
TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) {
if (t3&TY_MASK==TY_REG)
@ -567,7 +567,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
temp=REG_RCX;
ICMov(tempi,TY_REG+RT_I64,temp,0,t3,r3,d3,ip);
}
i=ICModr1(temp,t2&TY_MASK+type_pointed,r2,d2);
i=ICModr1(temp,t2&TY_MASK+type_pointed_to,r2,d2);
if (tempi->ic_flags&ICF_LOCK)
ICU8(tempi,OC_LOCK_PREFIX);
ICRex(tempi,i.u8[1]);
@ -583,13 +583,13 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
result_reg=REG_RCX;
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
}
i=ICModr1(result_reg,t3&TY_MASK+type_pointed,r3,d3);
i=ICModr1(result_reg,t3&TY_MASK+type_pointed_to,r3,d3);
if (tempi->ic_flags&ICF_LOCK)
ICU8(tempi,OC_LOCK_PREFIX);
ICRex(tempi,i.u8[1]);
ICU16(tempi,i.u8[2]<<8+op.u8[0]);
ICModr2(tempi,i,d3,ip+4);
ICMov(tempi,t2&TY_MASK+type_pointed,r2,d2,
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,
TY_REG+RT_I64,result_reg,0,ip);
done=TRUE;
}
@ -601,7 +601,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
else {
result_reg=REG_RCX;
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
t2&TY_MASK+type_pointed,r2,d2,ip);
t2&TY_MASK+type_pointed_to,r2,d2,ip);
}
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
} else {
@ -611,7 +611,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
else {
result_reg=REG_RCX;
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
t2&TY_MASK+type_pointed,r2,d2,ip);
t2&TY_MASK+type_pointed_to,r2,d2,ip);
}
}
if (tempi->ic_flags&ICF_LOCK)
@ -621,7 +621,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
else
ICU8(tempi,0x48);
ICU16(tempi,0xC000+op.u8[0]+(result_reg&7)<<11);
ICMov(tempi,t2&TY_MASK+type_pointed,r2,d2,
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,
TY_REG+RT_I64,result_reg,0,ip);
}
}
@ -631,25 +631,25 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
if (!d3.u32[1]) {
if (tempi->ic_flags&ICF_NO_DEPEND_RESULT &&
t2&TY_MASK==TY_REG && d3(U64)<=MAX_I8) {
ICSlashOp(tempi,TY_DISP+type_pointed,r2,0,0x838000+op.u8[4],ip);
ICSlashOp(tempi,TY_DISP+type_pointed_to,r2,0,0x838000+op.u8[4],ip);
ICU8(tempi,d3);
done=TRUE;
} else if (op.u8[2]==0x24) {//AND
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
TY_DISP+type_pointed,REG_RCX,0,ip);
TY_DISP+type_pointed_to,REG_RCX,0,ip);
result_reg=REG_RAX;
if (tempi->ic_flags&ICF_LOCK)
ICU8(tempi,OC_LOCK_PREFIX);
ICU16(tempi,op.u8[3]<<8+0x40);
ICU32(tempi,d3);
ICMov(tempi,TY_DISP+type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
TY_REG+RT_I64,result_reg,0,ip);
done=TRUE;
} else if (type_pointed&RT_MASK<RT_I64) {//OR/XOR
} else if (type_pointed_to&RT_MASK<RT_I64) {//OR/XOR
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
TY_DISP+type_pointed,REG_RCX,0,ip);
TY_DISP+type_pointed_to,REG_RCX,0,ip);
result_reg=REG_RAX;
if (tempi->ic_flags&ICF_LOCK)
ICU8(tempi,OC_LOCK_PREFIX);
@ -663,7 +663,7 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
ICU16(tempi,op.u8[2]<<8+0x40);
ICU8(tempi,d3);
}
ICMov(tempi,TY_DISP+type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
TY_REG+RT_I64,result_reg,0,ip);
done=TRUE;
}
@ -677,13 +677,14 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed,
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
}
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+type_pointed,REG_RCX,0,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+type_pointed_to,REG_RCX,0,ip);
result_reg=REG_RBX;
if (tempi->ic_flags&ICF_LOCK)
ICU8(tempi,OC_LOCK_PREFIX);
ICU8(tempi,0x48);
ICU16(tempi,0xC000+op.u8[0]+(result_reg&7)<<11);
ICMov(tempi,TY_DISP+type_pointed,REG_RCX,0,TY_REG+RT_I64,result_reg,0,ip);
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
TY_REG+RT_I64,result_reg,0,ip);
}
}
if (t1&TY_MASK)
@ -723,8 +724,9 @@ U0 ICShift(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);
}
U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,I64 us,I64 is,I64 ip)
U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed_to,
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,
I64 us,I64 is,I64 ip)
{
I64 result_reg;
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
@ -735,7 +737,8 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
result_reg=r2;
else {
result_reg=REG_RAX;
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t2&TY_MASK+type_pointed,r2,d2,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
t2&TY_MASK+type_pointed_to,r2,d2,ip);
}
if (t3&TY_MASK!=TY_IMM)
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
@ -746,7 +749,8 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
result_reg=r2;
else {
result_reg=REG_RAX;
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t2&TY_MASK+type_pointed,r2,d2,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
t2&TY_MASK+type_pointed_to,r2,d2,ip);
}
}
if (result_reg>7)
@ -762,7 +766,7 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
}
} else
ICU16(tempi,is.u16[1]+(result_reg&7)<<8);
ICMov(tempi,t2&TY_MASK+type_pointed,r2,d2,TY_REG+RT_I64,result_reg,0,ip);
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,TY_REG+RT_I64,result_reg,0,ip);
} else {
if (tempi->ic_flags & ICF_A1_FIRST) {
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
@ -773,7 +777,7 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
}
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+type_pointed,REG_RDX,0,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+type_pointed_to,REG_RDX,0,ip);
result_reg=REG_RAX;
ICU8(tempi,0x48);
if (t3&TY_MASK==TY_IMM) {
@ -785,7 +789,8 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed,I64 t1,I64 r1,I64 d1,
}
} else
ICU16(tempi,is.u16[1]+(result_reg&7)<<8);
ICMov(tempi,TY_DISP+type_pointed,REG_RDX,0,TY_REG+RT_I64,result_reg,0,ip);
ICMov(tempi,
TY_DISP+type_pointed_to,REG_RDX,0,TY_REG+RT_I64,result_reg,0,ip);
}
if (t1&TY_MASK)
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);

40
Compiler/BackB.CPP

@ -397,17 +397,17 @@ U0 ICPreIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (tempc->ptr_stars_cnt && tempc1->size!=1) {
ICAddSubEctImm(tempi,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,tempc1->size,op.u16[3],ip);
} else
ICSlashOp(tempi,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,op,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
} else {
if (tempi->a1.type&TY_MASK==TY_REG)
@ -419,15 +419,15 @@ U0 ICPreIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
}
if (tempc->ptr_stars_cnt &&
tempc1->size!=1) {
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed,r,0,
TY_DISP+tempi->a1.type_pointed,r,0,
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
TY_DISP+tempi->a1.type_pointed_to,r,0,
tempc1->size,op.u16[3],ip);
} else
ICSlashOp(tempi,
TY_DISP+tempi->a1.type_pointed,r,0,op,ip);
TY_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
TY_DISP+tempi->a1.type_pointed,r,0,ip);
TY_DISP+tempi->a1.type_pointed_to,r,0,ip);
}
}
@ -438,17 +438,17 @@ U0 ICPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
if (tempc->ptr_stars_cnt && tempc1->size!=1)
ICAddSubEctImm(tempi,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,tempc1->size,op.u16[3],ip);
else
ICSlashOp(tempi,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,op,ip);
} else {
if (tempi->a1.type&TY_MASK==TY_REG &&
@ -461,12 +461,12 @@ U0 ICPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
}
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
TY_DISP+tempi->a1.type_pointed,r,0,ip);
TY_DISP+tempi->a1.type_pointed_to,r,0,ip);
if (tempc->ptr_stars_cnt && tempc1->size!=1)
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed,r,0,
TY_DISP+tempi->a1.type_pointed,r,0,tempc1->size,op.u16[3],ip);
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
TY_DISP+tempi->a1.type_pointed_to,r,0,tempc1->size,op.u16[3],ip);
else
ICSlashOp(tempi,TY_DISP+tempi->a1.type_pointed,r,0,op,ip);
ICSlashOp(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
}
}
@ -475,8 +475,8 @@ U0 ICDerefPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
I64 t,r;
CHashClass *tempc1=tempi->ic_class;
t=tempi->r.type&RT_MASK;
if (t>tempi->a1.type_pointed)
t=tempi->a1.type_pointed;
if (t>tempi->a1.type_pointed_to)
t=tempi->a1.type_pointed_to;
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (tempi->a1.type&TY_MASK==TY_REG)
r=tempi->a1.reg;
@ -526,7 +526,7 @@ U0 ICAssignPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
r=REG_RDX;
}
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,r,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
@ -540,7 +540,7 @@ U0 ICAssignPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_I64,REG_RDX,0,ip);
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,

17
Compiler/BackC.CPP

@ -160,13 +160,13 @@ U0 ICAssign(CIntermediateCode *tempi,I64 ip)
{
CIntermediateCode *tempi1;
if (tempi->ic_flags & ICF_NOT_ADDR) {
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
if (tempi->r.type&TY_MASK) {
if (tempi->a1.type&TY_MASK==TY_REG)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
else
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
@ -182,7 +182,8 @@ U0 ICAssign(CIntermediateCode *tempi,I64 ip)
tempi->a2.reg==tempi->a1.reg ||
tempi->r.type&TY_MASK ||
tempi1->ic_flags&~ICG_NO_CVT_MASK) {
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,tempi->a1.reg,tempi->a1.disp,
ICMov(tempi,
TY_DISP+tempi->a1.type_pointed_to,tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
@ -192,14 +193,14 @@ U0 ICAssign(CIntermediateCode *tempi,I64 ip)
~ICF_CODE_FINAL|ICF_DONT_RESTORE;
tempi->a1.disp=tempi1->ic_data;
OptSetNOP1(tempi1); //This better not be last pass!
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
}
} else {
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
ICMov(tempi,TY_DISP+tempi->a1.type_pointed,REG_RCX,0,
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
if (tempi->r.type&TY_MASK)
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
@ -706,7 +707,7 @@ U0 ICAndEqu(CIntermediateCode *tempi,I64 ip2)
return;
}
}
ICAddSubEctEqu(tempi,tempi->a1.type_pointed,
ICAddSubEctEqu(tempi,tempi->a1.type_pointed_to,
tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,0x210425240423,ip2);
@ -727,7 +728,7 @@ U0 ICOrEqu(CIntermediateCode *tempi,I64 ip2)
return;
}
}
ICAddSubEctEqu(tempi,tempi->a1.type_pointed,
ICAddSubEctEqu(tempi,tempi->a1.type_pointed_to,
tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,0x09010D0C010B,ip2);
@ -748,7 +749,7 @@ U0 ICXorEqu(CIntermediateCode *tempi,I64 ip2)
return;
}
}
ICAddSubEctEqu(tempi,tempi->a1.type_pointed,
ICAddSubEctEqu(tempi,tempi->a1.type_pointed_to,
tempi->r.type,tempi->r.reg,tempi->r.disp,
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,0x310635340633,ip2);

36
Compiler/BackFA.CPP

@ -9,7 +9,7 @@ U0 CmpNoteFloatOp(CCmpCtrl *cc,CIntermediateCode *tempi,
Bool link=FALSE;
if (cc->pass==7 && cc->last_float_op_ic &&
cc->last_dont_popable && dont_pushable) {
nobound_switch (pos) {
switch [pos] {
case CN_A2:
if (cc->last_float_op_ic!=tempi && cc->dont_push_float)
link=TRUE;
@ -589,15 +589,15 @@ U0 ICFModEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip)
if (tempi->ic_flags & ICF_NOT_ADDR) {
if (dont_push_float) {
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
if (tempi->a1.type_pointed!=RT_F64)
if (tempi->a1.type_pointed_to!=RT_F64)
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,FALSE,ip);
} else if (tempi->ic_flags & ICF_A1_FIRST) {
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
if (tempi->a1.type_pointed!=RT_F64)
if (tempi->a1.type_pointed_to!=RT_F64)
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
@ -605,28 +605,28 @@ U0 ICFModEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip)
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed,
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
tempi->a1.reg,tempi->a1.disp,ip);
if (tempi->a1