Wednesday 3 July 2019

Assembler emulator

Here it is an assembler x86 emulator wrote in Livecode by Andre Garcia:
You can download from here:: http://tinyurl.com/p48nhwd
There are 4 registers: ax, bx, cx, dx.
These are the commands;
  • GET - ask a number
  • PUT - shows ax register
  • MOV - copy the target register
    • MOV <target>, <register>
    • MOV <target>, <number>
  • CMP - compare registers
  • JA - jump if greater than
  • JB - jump if less than
  • JAE - jump if greater or equal
  • JBE - jump if less or equal
  • JNA - jump if not greater
  • JNB -jump if not less
  • JE -jump if equal
  • JNE -jump if not equal
  • JMP - jump!
  • XCHG - exchange 2 registers
  • ADD - add
  • SUB - subtract
  • AND - bitwise and
  • OR - bitwise or
  • XOR - exclusive or
  • CALL - call a  subroutine
  • RET - return from a  subroutine
  • HALT - stop the software
  • SETE - set 1/0 if equal
  • SETNE - set 1/0 if not equal
  • SETLE - set 1/0 if lower or equal
  • SETL - set 1/0 if lower
  • SETG - set 1/0 if greater
  • SETGE - set 1/0 if greater or equal
  • SETNLE - set 1/0 if not lower or equal
  • SETNL - set 1/0 if not lower
  • SETNGE - set 1/0 if not greater or equal
  • SETNG - set 1/0 if not greater


Tuesday 2 July 2019

Menu builder


Menu builder is a tool in Livecode to create cool top menu:

Please not that on Mac it appears externally of the program:

Normal

On a Mac

The too in in the menu Tool -> Menu Builder:
On the left there are the main menu items, on the right the submenu of each item.
Dal menu builder potete aggiungere tutta una serie di effetti semplicemente usando il mouse, e le modifiche appariranno nel nome con un codice. This is the list of special chars and their meanings:
  • -   simple dash is a line divider
  • !c  this put a check before the menu item
  • !n this remove a check before the menu item
  • !r this put a list point before the item
  • !u this remove a list point before the item
  • & special char to call the item
  • / shortcat chara
  • ( rende il menu disabilitato
  • TAB to creat esubmenus
Fo examle this text
produce this:

You can use tags to change just what you see, but not the command; for example wiht multiple languages, you change only the tag. Example

Paste/V|Incolla





Monday 1 July 2019

Creating PDF with links

Livecode permits you to print any part of your programs as a PDF (or on a real printer).
If you want, you can create a PDF with links. The command to use is print link.
For example on a window create a text (http://www.paypal.com) and the use Text-> Link menu. Like this:




For example the button code is:

on mouseUp
   set the printPaperSize to (item 3 to 4 of the rect of this stack)
   put the rect of field "example" into temp
   ask file "Save PDF as:" with "Example.pdf"   
   if it is empty then
      exit mouseUp
   end if
   open printing to PDF it   
   print card 1 of this stack   
   print link to URL "http://www.paypal.com/" with rect temp
   close printing
end mouseUp

This is the result in a PDF reader: