🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #233

Re: writing an AVR disassembler

#233
From: dxf
Date: Tue, 17 Nov 2026 14:51
22 lines
1675 bytes
On 16/11/2026 11:57 am, dxf wrote:
> On 16/11/2026 9:55 am, Ivan Shmakov wrote:
>> ... 
>> 	I /think/ that UNNIBBLE in particular can be made simpler,
>> 	but it's not obvious to me how.  (Or do I just use some
>> 	built-in word here instead?)
> 
> My 'built-in' (kernel) word is >DIGIT and was designed to be 'general
> purpose'.  It's coded in assembler but here's a high-level version.
> It's case-sensitive to handle situations where lowercase would amount
> to an error.  It returns 'char' in the event of error should one want
> to print it.
> ...

According to pForth (github) it has DIGIT with the same stack effect as
mine.  It differs in that it is case-insensitive i.e. 'a' is treated as 'A'.
Based on that, then this should work:

  : UNNIBBLE ( c - n )
      ( Convert a hex digit character into a number )
      16 DIGIT 0= ABORT" character not in the 0-9a-fA-F range" ;
Technical Details
Message-ID: <6afc6a01$1@news.ausics.net>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!news.bbs.nz!news.ausics.net!not-for-mail
References: <UOSz15Vn9V7SG_X-@violet.siamics.net> <6afa54e3$1@news.ausics.net>

Show Full Headers
Complete Article Headers
Date: Wed, 18 Nov 2026 01:51:44 +1100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: writing an AVR disassembler
Newsgroups: comp.lang.forth
References: <UOSz15Vn9V7SG_X-@violet.siamics.net> <6afa54e3$1@news.ausics.net>
Content-Language: en-GB
From: dxf <dxforth@gmail.com>
In-Reply-To: <6afa54e3$1@news.ausics.net>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: news.ausics.net
Message-ID: <6afc6a01$1@news.ausics.net>
Organization: Ausics - https://newsgroups.ausics.net
Lines: 22
X-Complaints: abuse@ausics.net
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!news.bbs.nz!news.ausics.net!not-for-mail