<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title> words/itype.asm </title>
    <meta name="keywords" content="amforth programming language Forth ATmega ATMEL">
    <meta name="description" content="amforth - laguage Forth for ATMEL ATmega">
    <!-- AUTOINCLUDE START "Page/Head.en.ihtml" DO NOT REMOVE -->
    <link rel="StyleSheet" href="../../../../Web/CSS/MLAB.css" type="text/css" title="MLAB Basic Style">
    <link rel="StyleSheet" href="../../../../Web/CSS/MLAB_Print.css" type="text/css" media="print">
    <link rel="shortcut icon" type="image/x-icon" href="../../../../Web/PIC/MLAB.ico">
    <script type="text/javascript" src="../../../../Web/JS/MLAB_Menu.js"></script>
    <!-- AUTOINCLUDE END -->
  </head>

  <body lang="en">

    <!-- AUTOINCLUDE START "Page/Header.en.ihtml" DO NOT REMOVE -->
    <!-- ============== HEADER ============== -->
    <div class="Header">
      <script type="text/javascript">
      <!--
        SetRelativePath("../../../../");
        DrawHeader();
      // -->
      </script>
      <noscript>
        <p><b> JavaScript is required for including of the header </b></p>
      </noscript>
    </div>
    <!-- AUTOINCLUDE END -->

    <!-- AUTOINCLUDE START "Page/Menu.en.ihtml" DO NOT REMOVE -->
    <!-- ============== MENU ============== -->
    <div class="Menu">
      <script type="text/javascript">
      <!--
        SetRelativePath("../../../../");
        DrawMenu();
      // -->
      </script>
      <noscript>
        <p><b> JavaScript is required for including of the menu </b><p>
      </noscript>
    </div>
    <!-- AUTOINCLUDE END -->

    <!-- ============== TEXT ============== -->
    <div class="Text">

      <h1> words/itype.asm </h1>

      <p>
        <input type=button onClick="history.back()" value="Back">
        <input type=button onClick="history.forward()" value="Forward">
        <a href="../WordList.en.html">Jump to Vocabulary</a>
      </p>

      <pre>
; ( addr n --  ) Tools
; R( -- )
; reads packed string from flash and emit it
VE_ITYPE:
    .db $05, &quot;itype&quot;
    .dw VE_HEAD
    .set VE_HEAD = VE_ITYPE
XT_ITYPE:
    .dw DO_COLON
PFA_ITYPE:
    .dw XT_DUP
    .dw XT_EQUALZERO
; IF
    .dw XT_DOCONDBRANCH
    .dw PFA_ITYPE1
    .dw XT_DROP
    .dw XT_DROP
    .dw XT_EXIT
; THEN

PFA_ITYPE1:
    .dw XT_DUP
    .dw XT_DOLITERAL
    .dw $0001
    .dw XT_EQUAL
; IF
    .dw XT_DOCONDBRANCH
    .dw PFA_ITYPE2
    .dw XT_DROP
        .dw XT_IFETCH
    .dw XT_HIEMIT
    .dw XT_EXIT
; THEN

PFA_ITYPE2:
    .dw XT_OVER
    .dw XT_IFETCH
    .dw XT_HIEMIT
    .dw XT_DUP
    .dw XT_2SLASH
    .dw XT_1MINUS
    .dw XT_TO_R       ; &gt;r  save k=m-1
    .dw XT_R_FETCH    ; r@
    .dw XT_GREATERZERO
; IF
    .dw XT_DOCONDBRANCH
    .dw PFA_ITYPE4
    .dw XT_SWAP
    .dw XT_R_FETCH  ; r@  get k
    .dw XT_ZERO
 ; DO
    .dw XT_DODO
    .dw PFA_ITYPE7
PFA_ITYPE3:
    .dw XT_1PLUS
    .dw XT_DUP
    .dw XT_IFETCH
    .dw XT_DUP
    .dw XT_LOEMIT
    .dw XT_HIEMIT
    .dw XT_DOLOOP
    .dw PFA_ITYPE3
 ; LOOP
PFA_ITYPE7:
    .dw XT_SWAP
; THEN

PFA_ITYPE4:
    .dw XT_SWAP
    .dw XT_1PLUS
    .dw XT_SWAP
    .dw XT_DOLITERAL
    .dw $0001
    .dw XT_AND
    .dw XT_EQUALZERO
; IF
    .dw XT_DOCONDBRANCH
    .dw PFA_ITYPE5
    .dw XT_IFETCH
    .dw XT_LOEMIT
    .dw XT_DOBRANCH
    .dw PFA_ITYPE6
; ELSE
PFA_ITYPE5:
    .dw XT_IFETCH
    .dw XT_DUP
    .dw XT_LOEMIT
    .dw XT_HIEMIT
; THEN
PFA_ITYPE6:
    .dw XT_R_FROM  ; remove k
    .dw XT_DROP
    .dw XT_EXIT

; ( w -- )
; R( -- )
; content of cell fetched on stack.
;VE_LOEMIT:
;    .db $06, &quot;loemit&quot;
;    .dw VE_HEAD
;    .set VE_HEAD = VE_LOEMIT
XT_LOEMIT:
    .dw DO_COLON
PFA_LOEMIT:
    .dw XT_DOLITERAL
    .dw $00ff
    .dw XT_AND
    .dw XT_EMIT
    .dw XT_EXIT



; ( w -- )
; R( -- )
; content of cell fetched on stack.
;VE_HIEMIT:
;    .db $06, &quot;hiemit&quot;
;    .dw VE_HEAD
;    .set VE_HEAD = VE_HIEMIT
XT_HIEMIT:
    .dw DO_COLON
PFA_HIEMIT:
        .dw XT_DOLITERAL
        .dw 8
        .dw XT_RSHIFT
        .dw XT_EMIT
        .dw XT_EXIT

</pre>

      <p>
        <input type=button onClick="history.back()" value="Back">
        <input type=button onClick="history.forward()" value="Forward">
        <a href="../WordList.en.html">Jump to Vocabulary</a>
      </p>

    </div>

    <!-- AUTOINCLUDE START "Page/Footer.en.ihtml" DO NOT REMOVE -->
    <!-- ============== FOOTER ============== -->
    <div class="Footer">
      <script type="text/javascript">
      <!--
        SetRelativePath("../../../../");
        DrawFooter();
      // -->
      </script>
      <noscript>
        <p><b> JavaScript is required for including of the footer </b></p>
      </noscript>
    </div>
    <!-- AUTOINCLUDE END -->

  </body>
</html>