Bugzilla – Attachment 187 Details for
Bug 205
.align directive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bastian's original patch (for posterity)
align.patch (text/plain), 1.64 KB, created by
ggn
on 2022-07-23 12:12:53 CDT
(
hide
)
Description:
Bastian's original patch (for posterity)
Filename:
MIME Type:
Creator:
ggn
Created:
2022-07-23 12:12:53 CDT
Size:
1.64 KB
patch
obsolete
>diff --git a/direct.c b/direct.c >index 585764a..7b2e7e4 100644 >--- a/direct.c >+++ b/direct.c >@@ -90,6 +90,7 @@ int d_prgflags(void); > int d_opt(void); > int d_dsp(void); > int d_objproc(void); >+int d_align(void); > void SetLargestAlignment(int); > > // Directive handler table >@@ -163,6 +164,7 @@ int (*dirtab[])() = { > d_opt, // 66 .opt > d_objproc, // 67 .objproc > (void *)d_dsm, // 68 .dsm >+ d_align // 69 .align > }; > > >@@ -841,6 +843,35 @@ int d_qphrase(void) > return 0; > } > >+// >+// Adjust location to a <alignment> bytes >+// >+int d_align(void) >+{ >+ unsigned bytesToSkip; >+ uint64_t eval; >+ >+ if (abs_expr(&eval) != OK) >+ return 0; >+ >+ bytesToSkip = eval - (rgpu || rdsp ? orgaddr : sloc) % eval; >+ if ( bytesToSkip != eval ) >+ { >+ if ((scattr & SBSS) == 0) >+ { >+ D_ZEROFILL(bytesToSkip); >+ } >+ else >+ { >+ sloc += bytesToSkip; >+ >+ if (orgactive) >+ orgaddr += bytesToSkip; >+ } >+ } >+ return 0; >+} >+ > > // > // Do auto-even. This must be called ONLY if 'sloc' is odd. >@@ -1156,7 +1187,7 @@ int d_ds(WORD siz) > > if (expr(exprbuf, &eval, &eattr, NULL) < 0) > return ERROR; >- >+ > // Check to see if the value being passed in is negative (who the hell does > // that?--nobody does; it's the code gremlins, or rum, what does it) > // N.B.: Since 'eval' is of type uint64_t, if it goes negative, it will >@@ -2438,4 +2469,3 @@ int d_endif(void) > f_ifent = rif; > return 0; > } >- >diff --git a/direct.tab b/direct.tab >index d05e858..6fc66ce 100644 >--- a/direct.tab >+++ b/direct.tab >@@ -113,6 +113,8 @@ opt 66 > .objproc 67 > .dsm 68 > dsm 68 >+.align 69 >+align 69 > .if 500 > if 500 > .else 501 >@@ -133,4 +135,3 @@ rept 506 > endr 507 > .exitm 510 > exitm 510 >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 205
:
187
|
188
|
192
|
198