*/
VOID
-outab(b)
+outab(int b)
{
if (pass == 2) {
out_lb(b,0);
*/
VOID
-outaw(w)
+outaw(int w)
{
if (pass == 2) {
out_lw(w,0);
*/
VOID
-outdp(carea, esp)
-register struct area *carea;
-register struct expr *esp;
+outdp(register struct area *carea, register struct expr *esp)
{
register int n, r;
*/
VOID
-outall()
+outall(void)
{
if (oflag && pass==2)
outbuf("R");
*/
VOID
-outdot()
+outdot(void)
{
if (oflag && pass==2) {
fprintf(ofp, "T");
*/
VOID
-outchk(nt, nr)
+outchk(int nt, int nr)
{
register struct area *ap;
*/
VOID
-outbuf(s)
-char *s;
+outbuf(char *s)
{
if (txtp > &txt[2]) {
fprintf(ofp, "T");
*/
VOID
-outgsd()
+outgsd(void)
{
register struct area *ap;
register struct sym *sp;
*/
VOID
-outarea(ap)
-register struct area *ap;
+outarea(register struct area *ap)
{
register char *ptr;
register int c;
*/
VOID
-outsym(sp)
-register struct sym *sp;
+outsym(register struct sym *sp)
{
register char *ptr;
*/
VOID
-out_lb(b,t)
-register int b,t;
+out_lb(register int b, register int t)
{
if (cp < &cb[NCODE]) {
*cp++ = b;
*/
VOID
-out_lw(n,t)
-register int n,t;
+out_lw(register int n, register int t)
{
if (hilo) {
out_lb(hibyte(n),t ? t|R_HIGH : 0);
*/
VOID
-out_rw(n)
-register int n;
+out_rw(register int n)
{
if (hilo) {
*relp++ = hibyte(n);
*/
VOID
-out_tw(n)
-register int n;
+out_tw(register int n)
{
if (hilo) {
*txtp++ = hibyte(n);
*/
int
-lobyte(n)
+lobyte(int n)
{
return (n&0377);
}
*/
int
-hibyte(n)
+hibyte(int n)
{
return ((n>>8)&0377);
}
* 11 bit address. This form of address is used only on the 8051 and 8048.
*/
VOID
-outr11(esp, op, r)
-register struct expr *esp;
-int op;
-int r;
+outr11(register struct expr *esp, int op, int r)
{
- register int n;
-
- if (pass == 2) {
- if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
- /* equated absolute destination. Assume value
- * relative to current area */
- esp->e_base.e_ap = dot.s_area;
- }
-
- /* Relocatable destination. Build THREE
- * byte output: relocatable word, followed
- * by op-code. Linker will combine them.
- * Listing shows only the address.
- */
- r |= R_WORD | esp->e_rlcf;
- out_lw(esp->e_addr,r|R_RELOC);
- if (oflag) {
- outchk(3, 5);
- out_tw(esp->e_addr);
- *txtp++ = op;
-
- if (esp->e_flag) {
- n = esp->e_base.e_sp->s_ref;
- r |= R_SYM;
- } else {
- n = esp->e_base.e_ap->a_ref;
+ register int n;
+
+ if (pass == 2) {
+ if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
+ /* Absolute destination.
+ * Listing shows only the address.
+ */
+ out_lw(esp->e_addr,0);
+ if (oflag) {
+ outchk(3, 0);
+ out_tw(esp->e_addr);
+ *txtp++ = op;
+
+ write_rmode(r);
+ *relp++ = txtp - txt - 3;
+ out_rw(0xFFFF);
+ }
+ } else {
+ /* Relocatable destination. Build THREE
+ * byte output: relocatable word, followed
+ * by op-code. Linker will combine them.
+ * Listing shows only the address.
+ */
+ r |= R_WORD | esp->e_rlcf;
+ out_lw(esp->e_addr,r|R_RELOC);
+ if (oflag) {
+ outchk(3, 5);
+ out_tw(esp->e_addr);
+ *txtp++ = op;
+
+ if (esp->e_flag) {
+ n = esp->e_base.e_sp->s_ref;
+ r |= R_SYM;
+ } else {
+ n = esp->e_base.e_ap->a_ref;
+ }
+ write_rmode(r);
+ *relp++ = txtp - txt - 3;
+ out_rw(n);
}
- write_rmode(r);
- *relp++ = txtp - txt - 3;
- out_rw(n);
}
- }
- dot.s_addr += 2;
+ }
+ dot.s_addr += 2;
}
/*
VOID
outr19(struct expr * esp, int op, int r)
{
- register int n;
-
- if (pass == 2) {
- if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
- /* equated absolute destination. Assume value
- * relative to current area */
- esp->e_base.e_ap = dot.s_area;
- }
-
- /* Relocatable destination. Build FOUR
- * byte output: relocatable 24-bit entity, followed
- * by op-code. Linker will combine them.
- * Listing shows only the address.
- */
- r |= R_WORD | esp->e_rlcf;
- out_l24(esp->e_addr,r|R_RELOC);
- if (oflag) {
- outchk(4, 5);
- out_t24(esp->e_addr);
- *txtp++ = op;
+ register int n;
+
+ if (pass == 2) {
+ if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
+ /* Absolute destination.
+ * Listing shows only the address.
+ */
+ out_lw(esp->e_addr,0);
+ if (oflag) {
+ outchk(4, 0);
+ out_t24(esp->e_addr);
+ *txtp++ = op;
+
+ write_rmode(r);
+ *relp++ = txtp - txt - 4;
+ out_rw(0xFFFF);
+ }
+ } else {
+ /* Relocatable destination. Build FOUR
+ * byte output: relocatable 24-bit entity, followed
+ * by op-code. Linker will combine them.
+ * Listing shows only the address.
+ */
+ r |= R_WORD | esp->e_rlcf;
+ out_l24(esp->e_addr,r|R_RELOC);
+ if (oflag) {
+ outchk(4, 5);
+ out_t24(esp->e_addr);
+ *txtp++ = op;
- if (esp->e_flag) {
- n = esp->e_base.e_sp->s_ref;
- r |= R_SYM;
- } else {
- n = esp->e_base.e_ap->a_ref;
+ if (esp->e_flag) {
+ n = esp->e_base.e_sp->s_ref;
+ r |= R_SYM;
+ } else {
+ n = esp->e_base.e_ap->a_ref;
+ }
+ write_rmode(r);
+ *relp++ = txtp - txt - 4;
+ out_rw(n);
}
- write_rmode(r);
- *relp++ = txtp - txt - 4;
- out_rw(n);
}
- }
- dot.s_addr += 3;
+ }
+ dot.s_addr += 3;
}