Commit Graph

26 Commits

Author SHA1 Message Date
nickysn
fdc896ad0a + inline support for the x86 'in' and 'out' instructions. Currently only enabled
in the i8086-msdos 'ports' unit, but will be enabled on other targets (e.g.
  go32v2) in the future as well. 32-bit 'in' and 'out' not inlined on i8086, but
  will be on i386 and x86_64.

git-svn-id: trunk@39362 -
2018-07-03 17:01:42 +00:00
pierre
019da9517f Set return value when calling inherited in ti8086inlinenode.pass_typecheck_cpu
git-svn-id: trunk@39100 -
2018-05-23 20:43:40 +00:00
nickysn
c665866517 + introduce the tcnf_proc_2_procvar_2_voidpointer flag (for now it is only set,
but not used)

git-svn-id: trunk@38638 -
2018-03-27 16:15:06 +00:00
pierre
019a8b66dc Transform internal error into error message for seg(procvar) with is not usable for some i8086 memory models
git-svn-id: trunk@38219 -
2018-02-12 10:07:35 +00:00
florian
6400d612e8 + seg(<procvardef>) returns the segment stored in the procedure variable
git-svn-id: trunk@38216 -
2018-02-11 22:26:01 +00:00
nickysn
e23a13a482 * fixed seg(proc) in tp and delphi modes in all i8086 memory models
git-svn-id: trunk@38133 -
2018-02-06 13:00:08 +00:00
nickysn
899707979a - removed debug writeln, committed by accident in r37727
git-svn-id: trunk@38123 -
2018-02-05 16:39:31 +00:00
nickysn
ae52295232 * fixes for Seg(proc) for i8086
git-svn-id: trunk@37727 -
2017-12-13 16:56:01 +00:00
nickysn
04f0029b77 - don't generate addr_seg relocations for the Seg() directive on i8086, if the
load node didn't fill the segment value in the treference record; instead,
  just use the default segment for the reference

git-svn-id: trunk@37713 -
2017-12-11 17:18:07 +00:00
nickysn
b571f48735 * fixed the return type of FarAddr(), so that it is assignment compatible to
typed far pointers as well

git-svn-id: trunk@37629 -
2017-11-27 19:42:36 +00:00
nickysn
78e0f6c68b + added an i8086-specific FarAddr() function, similar to Addr(), but always
returns a far pointer, regardless of the current memory model

git-svn-id: trunk@37628 -
2017-11-27 16:41:48 +00:00
nickysn
d220d6f2c6 * use get_default_segment_of_ref() in the seg() handling on i8086
git-svn-id: trunk@37510 -
2017-10-23 14:55:52 +00:00
nickysn
ddba821561 * GetNextReg(), used by 16-bit and 8-bit code generators (i8086 and avr) moved
from cpubase unit to a method in the tcg class. The reason for doing that is
  that this is now a standard part of the 16-bit and 8-bit code generators and
  moving to the tcg class allows doing extra checks (not done yet, but for
  example, in the future, we can keep track of whether there was an extra
  register allocated with getintregister and halt with an internalerror in case
  GetNextReg() is called for registers, which weren't allocated as a part of a
  sequence, therefore catching a certain class of 8-bit and 16-bit code
  generator bugs at compile time, instead of generating wrong code).
- removed GetLastReg() from avr's cpubase unit, because it isn't used for
  anything. It might be added to the tcg class, in case it's ever needed, but
  for now I've left it out.
* GetOffsetReg() and GetOffsetReg64() were also moved to the tcg unit.

git-svn-id: trunk@37180 -
2017-09-11 14:53:06 +00:00
nickysn
4e489f2b33 + generate faster, branchless code for abs(int64) on i8086
git-svn-id: trunk@37172 -
2017-09-10 18:58:45 +00:00
nickysn
ebf4f715e8 + added a i8086 specific implementation of 32-bit abs(), which generates even
better code

git-svn-id: trunk@37162 -
2017-09-10 12:28:00 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
nickysn
c39128708e + implemented inc/dec for huge pointers
git-svn-id: trunk@29251 -
2014-12-10 23:52:46 +00:00
nickysn
4ea551a0f7 * is_farpointer and is_hugepointer moved from defutil to symcpu
git-svn-id: trunk@28328 -
2014-08-06 20:32:41 +00:00
nickysn
683478f00c + added a proper far pointer inc/dec implementation (operating only on the offset,
without touching the segment)

git-svn-id: trunk@27805 -
2014-05-19 16:24:25 +00:00
nickysn
5f57274b74 + proper i8086 Seg() implementation (i.e. support segments other than DS)
git-svn-id: trunk@27432 -
2014-04-01 19:11:39 +00:00
nickysn
cb0f7e265d + fixed get_frame for i8086 far data memory models
git-svn-id: trunk@26929 -
2014-03-02 19:36:35 +00:00
nickysn
97ca0fa323 - removed ti8086inlinenode.second_round_real, second_trunc_real and load_fpu_location as they mostly repeat the code in tx86inlinenode.load_fpu_location; tx86inlinenode.load_fpu_location adapted for i8086 instead
git-svn-id: branches/i8086@24237 -
2013-04-14 14:25:22 +00:00
nickysn
4d8adbf5ff + implemented Seg() for i8086 (small/tiny memory model)
git-svn-id: branches/i8086@24071 -
2013-03-30 13:04:58 +00:00
nickysn
f4b5b4ce0f * implemented Trunc() and Round() for i8086
git-svn-id: branches/i8086@23852 -
2013-03-16 03:34:23 +00:00
nickysn
e95d22d0f8 + added ti8086inlinenode
git-svn-id: branches/i8086@23833 -
2013-03-14 15:15:32 +00:00