Jump to content
Sign in to follow this  
Mac

Another Assembler Shortcoming?

Recommended Posts

Just wondering if I've run into another assembler shortcoming? Is there any way to use the address of a const rom char "table" in my assembly code?

 

typedef unsigned char u08;	  // 8-bit
#define r08 const rom unsigned char

//
//  rom character array
//
r08 font[] = { 0b01110000,	  // "0"
		   0b10001000,	  //
		   0b10011000,	  //
		   0b10101000,	  //
		   0b11001000,	  //
		   0b10001000,	  //
		   0b01110000,	  //
		   0b00100000,	  // "1"
		   0b01100000,	  //
		   0b00100000,	  //
		   0b00100000,	  //
		   0b00100000,	  //
		   0b00100000,	  //
		   0b01110000 };	//


//--< functions >----------------------------------------------------



void getromchar(u08 charval)	// 31 words, 43 cycles
{ asm						   //
 { movlw   7				   // tblptr = @romchar + charval * 7
mulwf   _charval			//
movlw   46				  // low(_font)	<--------------------- ???
addwf   _prodl,W			//
movwf   _tblptrl			//
movlw   0				   // high(_font)   <--------------------- ???
addwfc  _prodh,W			//
movwf   _tblptrh			//
clrf	_tblptru			//
tblrd*+					 //
movff   _tablat,_display+7  // display[7] = romchar[charval*7+0]
tblrd*+					 //
movff   _tablat,_display+15 // display[15] = romchar[charval*7+1]
tblrd*+					 //
movff   _tablat,_display+23 // display[23] = romchar[charval*7+2]
tblrd*+					 //
movff   _tablat,_display+31 // display[31] = romchar[charval*7+3]
tblrd*+					 //
movff   _tablat,_display+39 // display[39] = romchar[charval*7+4]
tblrd*+					 //
movff   _tablat,_display+47 // display[47] = romchar[charval*7+5]
tblrd*+					 //
movff   _tablat,_display+55 // display[55] = romchar[charval*7+6]
 }
}

Share this post


Link to post
Share on other sites

I tried to use LOW(0x1000) and HIGH(0x1000) or 4096%256 and 4096/256 assmebler operands after locating my rom character table at 0x1000 in Flash using #pragma DATA directives and still "go joy".

 

It seems that instead of building a good compiler around a full featured assembler that the assembler was more of an after thought. The assembler lacks any operand expression evaluation, won't use the LOW() and HIGH() operators for example, doesn't allow access to address of labels, and the list goes on...

 

By comparison the assembler in Swordfish BASIC is a good example of what the assembler in a HLL should be able to do. Too bad it's BASIC (LOL)...

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...